<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            min-width:550px
        }
        #header {
            text-align: center;
            background-color: #f1f1f1;
        }

        #container {
            padding-left: 200px;
            padding-right: 150px;
            /* 3.给左右两个盒子留出宽度 */
        }

        .column {
            float: left;  
            /* 1.实现float布局 */
        }

        #center {
            background-color: #ccc;
            width: 100%;
        }

        #left {
            position: relative;
            background-color: yellow;
            width: 200px;
            margin-left: -100%;
            right: 200px;
            /* 4.实现左边盒子位置问题，margin-left会让其有一个上浮的效果，因为它已经浮动起来了，往左拖拽 */
        }

        #right {
            background-color: red;
            width: 150px;
            margin-right: -150px;
            /* 5.现右边盒子位置问题 */

        }

        #footer {
            text-align: center;
            background-color: #f1f1f1;
            /* clear: both; */
            /* 2.去除footer两边浮动，让其维持在下方 */
        }

        .clearfix:after {
            content: '';
            display: table;
            clear: both;
            /* 手写clearfix */
            /* 解决让父元素包含浮动的子元素的问题 */
        }
    </style>
</head>
<body>
    <div id="header">
        this is header
    </div>
    <div id="container" class="clearfix">
        <div id="center" class="column">
            this is center
        </div>
        <div id="left" class="column">
            this is left
        </div>
        <div id="right" class="column">
            this is right
        </div>
    </div>
    <div id="footer">this is footer</div>
</body>
</html>